Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve draw performance of editor grids #29476

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

EVAST9919
Copy link
Contributor

Performance difference is most noticeable with circular grid.

master pr
master-circle pr-circle
master-rect pr-rect
master-triangle pr-triangle

Upon closer inspection you may see that grid alignment is slightly different. This is caused by the fact that grid line position may land between pixels and in that case grid isn't perfect as seen here (master)
master-rect
Unfortunately, same issue occurs with this pr, but in different places, thus causing the visual difference and I'm not sure whether this can be fixed completely.

@EVAST9919
Copy link
Contributor Author

Also there's an option to enable pixel snapping.
Enabling snapping helps to preserve overall clarity and looks much closer to the original look, but small blur caused by the linear filtering may help with aliasing a little.
So this one is up for debate.

master pr pr (+pixel snap)
master pr snap
master-small pr-small snap-small

@bdach bdach self-requested a review August 19, 2024 10:26
Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is okay. I wouldn't enable pixel snapping either because that is some really ugly aliasing on the screenshots provided.

The only caveat is that the draw overhead is basically moved to when the grid parameters are being updated, but that seems like a reasonable tradeoff.

@bdach bdach changed the title Make PositionSnapGrid a BufferedContainer Improve draw performance of editor grids Aug 19, 2024
@bdach bdach merged commit 24a0a3c into ppy:master Aug 19, 2024
11 of 13 checks passed
@EVAST9919 EVAST9919 deleted the buffered-editor-grid branch August 19, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants